package com.jxbeidou.system.config;

import com.baomidou.mybatisplus.extension.spring.MybatisSqlSessionFactoryBean;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import jakarta.annotation.Resource;
import javax.sql.DataSource;

/**
 * @program: jxbeidou-basic
 * @ClassName: MybatisConfig
 * @description: mybatis配置类
 * @author: 杜晓祥
 * @create: 2023-12-25 13:43
 * 版权所有：交信北斗(北京)信息科技有些公司
 */
//@Configuration
//@MapperScan(basePackages = "com.jxbeidou.system.*.mapper")
public class MybatisConfig {

//    @Resource
    private DataSource dataSource;

//    @Bean
    public MybatisSqlSessionFactoryBean mybatisSqlSessionFactoryBean() {

        MybatisSqlSessionFactoryBean mybatisPlus = new MybatisSqlSessionFactoryBean();
        mybatisPlus.setDataSource(dataSource);
        return mybatisPlus;
    }
}
